#pragma once

#ifndef GAMESTATE_H_
#define GAMESTATE_H_

#include <list>
#include <vector>
#include <string>
#include <sstream>
#include "SFML\Graphics\RenderWindow.hpp"
#include "SFML\Graphics\Text.hpp"
#include "SFML\Audio.hpp"
#include "Box2D\Box2D.h"
#include <rapidjson\rapidjson.h>
#include <rapidjson\document.h>
#include <rapidjson\reader.h>
#include <rapidjson\filestream.h>
#include <rapidjson\prettywriter.h>
#include "ShaderManager.h"
#include "TextureManager.h"
#include "SoundManager.h"
#include "Camera.h"

class ScreenBase;
class GameObject;
class Player;

using namespace rapidjson;
using namespace std;

//#define DEBUG_PATHS

#ifdef DEBUG_PATHS
const string levelsPath = "../../../assets/levels/";
const string fontsPath = "../../../assets/fonts/";
#else
const string levelsPath = "./assets/levels/";
const string fontsPath = "./assets/fonts/";
#endif

const double TIMESTEP = 0.001f;
const int MAX_LAYERS = 10;


class GameState
{

public:
	GameState(sf::RenderTarget &window);

	~GameState();

	void update(double dt);

	void draw();

	TextureManager& getTextureManager(){ return m_textureManager;}

	ShaderManager& getShaderManager(){ return m_shaderManager;}

	SoundManager& getSoundManager(){ return m_soundManager;}

	Font& getFont() { return m_font; }

	RenderTarget* getWindow() {return &m_window;}

	ScreenBase* getCurrentScreen(){ return m_currentScreen; }

	void setCurrentScreen(ScreenBase *screen);

	// Camera
	Camera camera;

private:
	ScreenBase *m_currentScreen;

	ScreenBase *m_nextScreen;

	// Managers
	ShaderManager m_shaderManager;

	TextureManager m_textureManager;

	SoundManager m_soundManager;

	sf::RenderTarget &m_window;

	Font m_font;

};

#endif